<?php

namespace App\Models;

use Encore\Admin\Traits\AdminBuilder;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\UserProductEvent
 *
 * @property int $id
 * @property string $user_id
 * @property string $product_id
 * @property int $type
 * @property string $title
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserProductEvent whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserProductEvent whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserProductEvent whereProductId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserProductEvent whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserProductEvent whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserProductEvent whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserProductEvent whereUserId($value)
 * @mixin \Eloquent
 * @property int $user_product_id
 * @property string|null $content
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserProductEvent whereContent($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserProductEvent whereUserProductId($value)
 */
class UserProductEvent extends Model
{
    protected $fillable = ['title', 'content', 'created_at', 'type'];
    use AdminBuilder;
    /**
     * 滤芯
     */
    const EVENT_FILTER = 1;
    const EVENT_FIX = 2;

    public function userProduct()
    {
        return $this->belongsTo(UserProduct::class);
    }
}
